home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 49 / Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso / -websites- / wirenet / files / updatewirenet.lzx / Updates / SendEvents < prev    next >
Text File  |  2006-02-12  |  2KB  |  56 lines

  1. /* $VER: SendEvents 1.2 (5.6.96) by Neil Bothwick               */
  2. /* Check if there are any outstanding events and if so send them */
  3.  
  4. /* Change these to suit your setup */
  5.  
  6. SystemName = 'Wirenet'                  /* The name of your Internet system in Thor */
  7. MaxTries   = 5                          /* Maximum number of retries */
  8.  
  9. /* Don't change anything below here */
  10.  
  11. EVE_DOWNLOAD     =  4
  12. EVE_UPLOAD       =  5
  13.  
  14. address command
  15.  
  16. if ~show('p', 'BBSREAD') then do
  17.     "run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead"
  18.     "WaitForPort BBSREAD"
  19.     end
  20.  
  21. if ~show('L','rexxdossupport.library') then
  22.     call addlib('rexxdossupport.library',0,-30)
  23.  
  24. do Try = 1 to MaxTries
  25.     if ActiveEvents() = 0 then leave
  26.     GetVar('Thor/ThorPath')||'bin/SendTCP BBSNAME' SystemName 'MAILSERVER $MAILSERVER NEWSSERVER $NEWSSERVER PUBSCREEN Workbench'
  27.     end
  28.  
  29. If ActiveEvents() > 0 then Ouch('SendTCP failed')
  30.  
  31. exit
  32.  
  33.  
  34. ActiveEvents:
  35.     address BBSREAD
  36.     ActiveCount = 0
  37.     GETBBSDATA SystemName SystemData
  38.     do EventNo=SystemData.FIRSTEVENT to SystemData.LASTEVENT
  39.         drop EventData.
  40.         drop EventTags.
  41.         READBREVENT '"'SystemName'"' eventnr EventNo datastem EventData tagsstem EventTags
  42.         EventFlags = c2x(EventData.FLAGS)
  43.         if EventFlags = 0 | EventFlags = 8 then do
  44.             if EventData.EVENTTYPE ~= EVE_DOWNLOAD & EventData.EVENTTYPE ~= EVE_UPLOAD then return 1
  45.             end
  46.         end
  47.     address command
  48.     return 0
  49.  
  50. Ouch:
  51.     parse arg ErrMsg
  52.     say(ErrMsg)
  53.     exit
  54.     return
  55.  
  56.